home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: Jens M Andreasen <jens-and@dsv.su.se>
- Newsgroups: comp.lang.c,comp.lang.c.moderated
- Subject: Re: 8 Queens prog help
- Date: 21 Apr 1996 12:10:35 -0500
- Organization: Digital Solutions
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4ldq6b$5f2@solutions.solon.com>
- References: <4l87ud$73u@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
-
-
- Mike!
-
- It seems like your teacher want's you to mimic prolog in C? Tell him that
- this is generally a bad idea! The braindead logic of AI can never compete
- with the inspired mind of a C-programmer (plus a tiny bit of magic ;)
-
- The magic part:
- ---------------
- You wrote that you wanted to start at a random place? Let that be D1.
- This is the natural home that was given to the queen when history was
- young and should not be changed by you!
-
- Optimizing for speed:
- ---------------------
- Observing that at least one of the solutions is symmetric (mirrored
- through the center) you can place two queens on each call to the function
- that also evaluates legality.
-
- Eliminating braindamage:
- ------------------------
- Since the board is quit small we would like to place the queens very
- close together, right? As close as possible would be the move of the
- knight (one up, two to the right).
-
- Summing up:
- -----------
-
- 1) Start at D1
- 2) Place two queens symetrically on each call (D1 && E8 , etc)
- 3) Try to place the next queens a knights move away.
-
- // Jens M Andreasen
-